<template>
  <el-container class="index-con">
    <el-aside :class="showclass">
      <div class="logobox">
        云管系统
      </div>
      <leftnav></leftnav>
    </el-aside>
    <el-container class="main-con">
      <el-header class="index-header">
        <navcon></navcon>
      </el-header>
      <el-main class="index-main">
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>
<script>
// 导入组件
import navcon from '../components/navcon.vue'
import leftnav from '../components/leftnav.vue'
export default {
  name: 'index',
  data() {
    return {
      showclass: 'asideshow',
      showtype: false
    }
  },
  // 注册组件
  components: {
    navcon,
    leftnav
  },
  methods: {},
  created() {
    // 监听
    this.$root.Bus.$on('toggle', value => {
      if (value) {
        this.showclass = 'asideshow'
      } else {
        setTimeout(() => {
          this.showclass = 'aside'
        }, 0)
      }
    })
  },
  beforeUpdate() {},
  // 挂载前状态(里面是操作)
  beforeMount() {
    // 弹出登录成功
    // this.$message({
    //   message: '登录成功',
    //   type: 'success'
    // })
  }
}
</script>
<style scoped lang="less">
.index-con {
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

.aside {
  transition: width 1s ease;
  width: 0px !important;
  overflow: hidden;
  height: 100%;
  background-color: #001529;
  margin: 0px;
  .logobox{
    width: 0px !important;
    transition: width 1s ease;
    background-color: #00284D;
    height: 65px;
    box-sizing: border-box;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 70px;
    padding-left: 25px;
    font-size: 32px;
  }
}
.asideshow {
  transition: width 1s ease;
  width: 256px !important;
  height: 100%;
  background-color: #001529;
  margin: 0px;
  &::-webkit-scrollbar{
    display: none;
  }
  .logobox {
  transition: width 1s ease;
  height: 65px;
  line-height: 70px;
  font-size: 32px;
  background-color: #00284D;
  font-weight: 700;
  color: #FFFFFF;
  font-size: 32px;
  text-align: left;
  padding-left: 25px;
  position: absolute;
  top:0;
  left:0;
  width: 256px;
  box-sizing: border-box;
  z-index: 999;
  // width: 256px;
  overflow: hidden;
}
}
.index-header {
  height: 65px !important;
  padding: 0px;
  // border-left: 2px solid #333;
}
.main-con {
  background-color: #f0f2f5;
  /* padding: 25px; */
  /* border-left: 2px solid #333; */
}
.el-main{
  border-radius: 4px;
  margin:23px;
  padding:30px 46px;
  background-color: #fff;
}

</style>
